home *** CD-ROM | disk | FTP | other *** search
- /* NSZone.h
- Allocation of large regions
- Copyright 1994, NeXT, Inc.
- NeXT, March 1994
- */
-
- #import <objc/objc.h>
-
- @class NSString;
-
- /*************** NSZone definition ***************/
-
- typedef struct _NSZone NSZone;
-
- /*************** Operations on zones ***************/
-
- extern NSZone *NSDefaultMallocZone(void);
- /* Returns the default zone used by the malloc(3) calls. */
-
- extern NSZone *NSCreateZone(unsigned startSize, unsigned granularity, BOOL canFree);
- /* Create a new zone with its own memory pool. If canfree is 0 the allocator will never free memory and mallocing will be fast */
-
- extern void NSRecycleZone(NSZone *zone);
- /* Adds the pages still in use to the default zone */
-
- extern void NSSetZoneName(NSZone *zone, NSString *name);
- /* Sets the zone name */
-
- extern NSString *NSZoneName(NSZone *zone);
- /* Gets the name of a zone */
-
- /*************** Operations on pointers in zones ***********/
-
- extern void *NSZoneMalloc(NSZone *zone, unsigned size);
- /* Allocates in zone */
-
- extern void *NSZoneRealloc(NSZone *zone, void *ptr, unsigned size);
- /* Resizes in zone; ptr passed in may be NULL */
-
- extern void NSZoneFree(NSZone *zone, void *ptr);
- /* Recycles the memory */
-
- extern void *NSZoneCalloc(NSZone *zone, unsigned numElems, unsigned byteSize);
- /* Like NSZoneMalloc and then bzero. */
-
- extern NSZone *NSZoneFromPtr(void *ptr);
- /* Returns the zone for a malloced or realloced pointer, NULL if not in any zone. */
-